#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @creat_time      : 2023/9/18 15:34
# @author          : lijiantao
# @filename        :  / 
# @description     :

import os


def removepic(picpath, labelpath):
    for root,dirs,files in os.walk(picpath):
        for name in files:
            if not os.path.exists(os.path.join(labelpath, str(name[:-4])+".txt")):
                os.remove(os.path.join(picpath, name))
                print("remove pic: ", os.path.join(picpath, name))


if __name__ == '__main__':
    labelpath = ".\\label"
    picpath = ".\\img"
    removepic(picpath, labelpath)
